package com.jay.media.kit

/**
 * @author xuzhou4
 * @date 2022/3/22
 */
object ByteUtils {
    fun toHexString(source: ByteArray): String {
        val stringBuilder = StringBuilder()
        for (byte in source) {
            val s = Integer.toHexString(byte.toInt() and 0xFF)
            if (s.length < 2) {
                stringBuilder.append("0")
            }
            stringBuilder.append(s)
        }
        return stringBuilder.toString()
    }
}